/*******************************************************************************
 *                                    ZLG
 *                         ----------------------------
 *                         innovating embedded platform
 *
 * Copyright (c) 2001-present Guangzhou ZHIYUAN Electronics Co., Ltd.
 * All rights reserved.
 *
 * Contact information:
 * web site:    https://www.zlg.cn
 *******************************************************************************/
#ifndef __HPM6E00_REGS_OTP_H
#define __HPM6E00_REGS_OTP_H

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus*/
#include "core/include/hpm6e00_regs_base.h"
#include <stdint.h>

#define OTP_INT_FLAG_WRITE_POS   (2U)
#define OTP_INT_FLAG_WRITE_MASK  (1 << OTP_INT_FLAG_WRITE_POS)
#define OTP_INT_FLAG_READ_POS    (1U)
#define OTP_INT_FLAG_READ_MASK   (1 << OTP_INT_FLAG_READ_POS)

typedef struct {
    volatile uint32_t      shadow[128];                 /* 0x0 - 0x1FC: Fuse shadow registers */
    volatile uint32_t      shadow_lock[8];              /* 0x200 - 0x21C: Fuse shadow lock */
    volatile const uint8_t reserved0[480];              /* 0x220 - 0x3FF: Reserved */
    volatile uint32_t      fuse[128];                   /* 0x400 - 0x5FC: Fuse Array */
    volatile uint32_t      fuse_lock[8];                /* 0x600 - 0x61C: Fuse lock */
    volatile const uint8_t reserved1[480];              /* 0x620 - 0x7FF: Reserved */
    volatile uint32_t      unlock;                      /* 0x800: UNLOCK */
    volatile uint32_t      data;                        /* 0x804: DATA */
    volatile uint32_t      addr;                        /* 0x808: ADDR */
    volatile uint32_t      cmd;                         /* 0x80C: CMD */
    volatile const uint8_t reserved2[496];              /* 0x810 - 0x9FF: Reserved */
    volatile uint32_t      load_req;                    /* 0xA00: LOAD Request */
    volatile uint32_t      load_comp;                   /* 0xA04: LOAD complete */
    volatile const uint8_t reserved3[24];               /* 0xA08 - 0xA1F: Reserved */
    volatile uint32_t      region[4];                   /* 0xA20 - 0xA2C: LOAD region */
    volatile const uint8_t reserved4[464];              /* 0xA30 - 0xBFF: Reserved */
    volatile uint32_t      int_flag;                    /* 0xC00: interrupt flag */
    volatile uint32_t      int_en;                      /* 0xC04: interrupt enable */
} hpm_otp_reg_t;

#define HPM_OTP  ((hpm_otp_reg_t *)HPM_OTP_BASE)


#ifdef __cplusplus
}
#endif  /* __cplusplus  */
#endif
